<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>焦点学苑</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/style.css">
<!-- vue -->
<script type="text/javascript" src="https://lib.baomitu.com/vue/2.6.12/vue.min.js"></script>
<!-- axios -->
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.0/axios.min.js"></script>
<!-- 需要先引入 vue 再引入控件 -->
<script src="js/top.js"></script>
<script src="js/category.js"></script>
<style>
/* 对超链接文本的css设置更改*/
a{text-decoration: none;color:#666666;cursor:pointer}
</style>
</head>

<body>
<div class="head-box">
<div id="login-btm1">
    <div class="head wrap" >
          <div class="logo fl"><a href=""><img src="images/logo.png"></a></div>
          <div class="head-right fr">
          	
              <div class="head-a fr">
                   <div class="hgt fl"><img src="images/hgt.png">
                         <div class="hgt-top">
                             <input type="text" class="hgt-text" >
                         </div>
                   </div>
                   <div class="tbt fl"><img v-if="jpg" :src="jpg" style="height:32px;width:32px"><img v-if="!jpg" src="upload/ttt.png">
                        <div class="hgt-btm">
                        	 <a v-if="!jpg" v-else if="!unread.sendUid"  class="head-a3 login-click fl" id="loginA">登录</a><br></br>
                             <a  @click.prevent="checkLogin" style="cursor:pointer">我的主页</a>
                             <a v-if="unread.sendUid" :href="'session.html?recvUid='+unread.sendUid">有新消息！</a>
                             <a v-if="jpg" href="">我的关注</a>
                             <a @click.prevent="checkLogin2" style="cursor:pointer">帐号设置</a>
                             <a v-if="jpg" @click.prevent="exit" >退出</a>
                        </div>
                   </div>
                   <script></script>
              </div>
              <div class="clearfix"></div>
              <div class="nav fr">
                  <ul>
                       <li><a href="index.html">首页</a></li>
                       <li><a href="">文章</a>
                           <category></category>
                       </li>
                       <li class="nav-cut"><a href="community.html">社区</a></li>
                       <li><a href="course.html">课程</a></li>
                       <li><a href="active.html">活动</a></li>
                       <li><a href="contact.html">联系我们</a></li>
                  </ul>
              </div>
              <div class="clearfix"></div>
          </div>
    </div>
   
<!--登录注册弹窗-->
<div class="mask"></div>
<div class="login" id="login1">
    <div class="login-title">
        <div class="login-a">登录</div>
        <div class="login-b"></div>
        <div class="login-c close">x</div>
    </div>
    <div class="login-btm">
        <div class="login-d"><input v-model="user.uname" type="text" class="login-text" placeholder="注册时填写的用户名"></div>
        <div class="login-d"><input v-model="user.upass" type="password" class="login-pas" placeholder="密码"></div>
        <div class="login-d"><input  @click.prevent="login"  type="button" class="login-btn" value="登录"></div>
        <div class="login-f">
             <a href="">忘记密码</a>
             <span>还没有焦点账号?><a href="javascript:;" class="reg-href">点击注册</a></span>
        </div>
    </div>
</div>
</div>
<script >
var v5 = new Vue({
	el:"#login-btm1",
	data:{
		//vue花括号中可以不写 	
		user:{uname:"",upass:""},
		jpg:"",
		uid:"",
		unread:{sendUid:"",recvUid:""},
	},
	created(){
		var params = new URLSearchParams();
		axios.get("getloginUser.s").then(res=>{
			if(res.data!=null){
				this.jpg=res.data.ujpg;
				//$("#loginA").hide();
				this.uid=res.data.uid;
				
			}
			params.append("loginUid",this.uid);
			axios.post("msg/selectunread.s",params).then(res=>{
				console.info(res.data);
				this.unread.sendUid=res.data[0].sendUid;
				console.info(this.unread);
			});
			
		})
	},
	methods:{
		checkLogin(){
			var params = new URLSearchParams();
			console.info("dasfsa");
			axios.post("checkLogin.s",params).then(res=>{
				if((res.data.code)==0){
					//$(".mask,.login").show();
					
				        $(".mask").css({
				            display: "block", height: $(document).height()
				        });
						 var $box = $('.login');
				        $box.css({
				           display: "block"
				        });
						$(".close").click(function () {
				        $(".mask,.login").css("display", "none");
				       });

				    
				}else{
					location.href="user-article.html";
				}
			})
		},
		checkLogin2(){
			var params = new URLSearchParams();
			console.info("dasfsa");
			axios.post("checkLogin.s",params).then(res=>{
				if((res.data.code)==0){
					//$(".mask,.login").show();
						 alert(res.data.msg);
				        /*$(".mask").css({
				            display: "block", height: $(document).height()
				        });
						 var $box = $('.login');
				        $box.css({
				           display: "block"
				        });
						$(".close").click(function () {
				        $(".mask,.login").css("display", "none");
				       });
 */
				}else{
					location.href="account.html";
				}
			})
		},
		login(){
			console.info("xx");
			var params = new URLSearchParams();
			params.append("username",this.user.uname);
			params.append("password",this.user.upass);
			
			axios.post("userHead.s",params).then(res=>{
				
				console.log(res.data)
				this.jpg=res.data.ujpg;
			});
			axios.post("user/login.s",params).then(res=>{
				 if(res.data.uid){
						//关闭div
						$(".mask,.login").css("display", "none");
						$("#loginA").hide();
						location.reload();
					}else{
						
						alert(res.data.msg);
					} 
			})
		},
		exit(){
			axios.post("user/exit.s").then(res=>{
				location.href="community.html";
			})
		}
	}
})
</script>
<div class="reg">
    <div class="login-title">
        <div class="login-a">注册</div>
        <div class="login-b"></div>
        <div class="login-c close">x</div>
    </div>
    <div class="login-btm">
        <div class="login-d"><input type="text" class="login-text" placeholder="邮箱/手机号"></div>
        <div class="login-d"><input type="password" class="login-pas" placeholder="密码"></div>
        <div class="login-d"><input type="button" class="login-btn" placeholder="注册"></div>
        <div class="login-f">
             <a href="">忘记密码</a>
        </div>
    </div>
</div>
</div>

<div class="content">
    <div class="wrap">
          <div class="art-height"></div>
          <div class="community">
               <div class="com-fl fl">
                       <div class="hd">
                          <ul><li style="background:url(aimage/postimg1.jpg) no-repeat center center;height:289px"></li>
                              <li style="background:url(aimage/postimg2.jpg) no-repeat center center;height:289px"></li>
                              <li style="background:url(aimage/postimg3.jpg) no-repeat center center;height:289px"></li></ul>
                       </div>
                       <div class="bd"><ul></ul></div> 
               </div>
               <div class="com-fr fr">
                       <div class="com-a">
                            <div class="com-a1">这个暖春，厦门是我最想和你牵手去的地方</div>
                            <div class="com-a2">想带家人去厦门旅游，5天时间够玩吗？哪些景点比较好玩？游玩路线怎么安排合理？人挤人排队买票太费劲了，听说...<a href="">[查看全文]</a></div>
                       </div>
                       <div class="com-b">
                            <div v-for="c in list" class="com-b1"><a :href="'article-details.html#' + c.tid" >{{c.atitle}}</a><span>浏览次数：{{c.viewnumber}}</span></div>
                       </div>
                       <script>
                       new Vue({
                    	   el : ".com-b",
                    	   data : {
                    		   list : []
                    	   },
	                       created(){
	                		   axios.get("community.s").then(res=>{
	                			   this.list = res.data;
	                		   });
	                		   
	                	   }
                       });
                       </script> 
               </div>
          </div>
          
          <div class="ru">
                <div class="ru-fl fl">
                        <div class="ru-a">
                               <div class="ru-title">
                                       <div class="cou-b1"><img src="images/cou-b1.jpg">帖子</div>
                                       <div class="ru-a1">
                                             <div class="sort">排序</div>
                                       </div>
                                       <div class="ru-a2">
                                             <div class="dropdown">
                                                    <span>情感</span>
                                                     <ul data-value="" class="droplist">
                                                                <li data-id="1">全部</li>
                                                                <li data-id="2">服饰</li>
                                                                <li data-id="3">最新</li>
                                                                <li data-id="4">提问</li>
                                                                <li data-id="5">约会技巧</li>
                                                                <li data-id="6">热门文章</li>
                                                     </ul>
                                             </div>
                                       </div>
                               </div>
                         </div>
                         <div class="ru-b">
                                <ul v-for=" p in list">
                                     <li>
                                           <div class="wt-fl fl"><a :href="'others-homepage.html#' +	p.uid">
                                                 <div class="wt-a1"><img :src="p.ujpg"></div>
                                                 <div class="wt-a2">{{p.uname}}</div></a>
                                                  <a :href="'community-post.html#' +	p.pid">
                                           </div>
                                           <div class="wt-fr fl">
                                                  <div class="wt-r1">{{p.pname}}</div>
                                                  <div class="wt-r2">{{p.pdate}}</div>
                                                  
                                           </div>
                                      </li></a>
                                </ul>
<!--                                 <div class="skt-more com-more"><a href="">查看更多</a></div> -->
                         </div>
                         <script>
                         //展示帖子的vue
                        var v3= new Vue({
                        	 el : ".ru-b",
                        	 data : {
                      		   list : []
                      	   },
  	                       created(){
  	                		   axios.post("post/searchPost.s").then(res=>{
  	                			   this.list = res.data;
  	                		   });
  	                	   }
                         });
                         </script>
                         

                         
                                
                </div><!--ru-fl--> 
                
                <div class="ru-fr fr">
                       <div class="ru-c1"><a @click.prevent="checkLogin3" style="cursor:pointer">发表帖子</a></div>
                       <div class="ru-c2"><img src="images/cou-b1.jpg">热门标签</div>
                       <div class="ru-c3">
                           <span>娱乐</span>
                           <span>吃瓜</span>
                           <span>美女</span>
                           <span>帅哥</span>
                           <span>交友</span>
                           <span>有趣</span>
                           <span>出行</span>
                           <span>街拍</span>
                       </div>
                       <div class="ru-c2"><img src="images/cou-b1.jpg">热门帖子</div>
                       <div class="ru-c4">
                            <div class="ru-c5">
                                   <div class="ru-d fl">热</div>
                                   <div class="ru-e fl">
                                       <div class="ru-e1">有趣的包装|包装设计|平面设计</div>
                                       <div class="ru-e2"><img src="ujpgs/f/f1.jpg">shuiguodaren<span>2015-11-02</span></div>
                                   </div>
                            </div>
                            <div class="ru-c5">
                                   <div class="ru-d fl">热</div>
                                   <div class="ru-e fl">
                                       <div class="ru-e1">体验有趣的创作</div>
                                       <div class="ru-e2"><img src="ujpgs/f/f1.jpg">shuiguodaren<span>2015-11-02</span></div>
                                   </div>
                            </div>
                            <div class="ru-c5">
                                   <div class="ru-d fl">热</div>
                                   <div class="ru-e fl">
                                       <div class="ru-e1">有趣的事物</div>
                                       <div class="ru-e2"><img src="ujpgs/f/f1.jpg">shuiguodaren<span>2015-11-02</span></div>
                                   </div>
                            </div>
                       </div>
                       <div class="ru-c6"><a href=""><img src="upload/gg.jpg"></a></div>
                </div>
                <script>
                var v5 = new Vue({
                	el:".ru-fr",
                	data:{},
                	methods:{
                		checkLogin3(){
                			var params = new URLSearchParams();
                			console.info("dasfsa");
                			axios.post("checkLogin.s",params).then(res=>{
                				if((res.data.code)==0){
                						 alert(res.data.msg);
                				}else{
                					location.href="post.html";
                				}
                			})
                		},
                	}
                })
                </script>
          </div><!--ru-->
    </div> 
</div>

<div class="footer">
   <div class="wrap">
      <div class="foot">
            <div class="foot-left fl">
                 <a href="">关于我们</a>
                 <a href="">加入我们</a>
                 <a href="contact.html">联系我们</a>
                 <a href="">媒体采访</a>
            </div>
            <div class="foot-c fl"><a href=""><img src="images/foot-logo.jpg"></a></div>
            <div class="foot-right fr">
                 <a href="">同城活动</a>
                 <a href="">课程资讯</a>
                 <a href="">最新发布</a>
                 <a href="">热门文章</a>
            </div>
       </div> 
       <div class="foot-btm">网页制作by云邦</div>    
   </div>
</div>




<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/Action.js"></script>
<script src="js/jquery.SuperSlide.2.1.1.js"></script>
<script>
   $(".com-fl").slide({
		    titCell: ".bd ul" , 
		    mainCell:".hd ul" , 
	        effect:"fold", 
	        autoPlay:true,
	        autoPage: true, 
		    mouseOverStop:false,
 		    trigger: "click",
		    startFun: function (i) {
                    var curLi = jQuery(".com-fl .bd li").eq(i);
                    if (!!curLi.attr("_src")) {
                        curLi.css("background-image", curLi.attr("_src")).removeAttr("_src")
                    }
                }
		 })	
</script>
<script>
   $(".sort").click(function(){
	   $(this).toggleClass("sort-cut")  
	})
</script>
<script>
   $(".dropdown").bind({
	    click: function () {
	        $(this).find(".droplist").stop().slideDown();
	    },
	    mouseleave: function () {
	        $(this).find(".droplist").hide();
	    }
	});
	$(".dropdown .droplist li").click(function () {
	    $(this).parents(".dropdown").children("span").text($(this).text());
	    $(this).parents(".droplist").hide().attr("data-value", $(this).attr("data-id"));
	});
</script>
</body>
</html>
